<?php

/**
 * Login form.
 * 
 * @author hcderaad
 * @package eicms
 * @subpackage forms
 *
 */
class EICms_Form_Login extends EICms_Form {
	
	public function init() {
		$action = $this->getAction();
		if(empty($action)) {
			$this->setAction('/auth/login');
		}
		
		$this->addElement('text','name',array(
			'label' => EICms_Translate::_('username'),
			'validators' => array(
				array('StringLength',false,array(5,20)),
				array('Alnum')
					),
			'required' => true	
			));
		
		$this->addElement('password','password',array(
			'label' => EICms_Translate::_('password'),
			'validators' => array(
				array('StringLength',false,array(5,20)),
				array('Alnum')
					),
			'required' => true		
			));
		
		$this->addDisplayGroup(array('name','password'),'authorlogin',array(
			'legend' => EICms_Translate::_('credentials')
			));
			
		$this->addElement('submit','submit',array(
			'label' => EICms_Translate::_('submit')
			));
		
		$this->addDisplayGroup(array('submit'),'authorloginsubmit',array(
			'class' => 'submit'
			));
	}
}
?>